/// hit by slime:
if (iframes <= 0) {
    global.hp -= 1;
    iframes = 45;
    var dir = point_direction(other.x, other.y, x, y);
    x += lengthdir_x(12, dir);   // knockback
    y += lengthdir_y(12, dir);
}

/// Step:
if (iframes > 0) {
    iframes--;
    visible = (iframes div 4) % 2 == 0;  // flash
} else visible = true;